﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using IfSoft.OA.Entities;

namespace IfSoft.OA.Business
{
    public class BankBillHelper
    {
        public static bool IsCanApproveOrDeny(string userName, BankBill bo)
        {
            bool flag = false;
            if (userName == "user1")
                flag = false;
            else if (userName == "user2" && string.IsNullOrEmpty(bo.Step2) && !string.IsNullOrEmpty(bo.Step1))
                flag = true;
            else if (userName == "user3" && string.IsNullOrEmpty(bo.Step3) && !string.IsNullOrEmpty(bo.Step2))
                flag = true;
            else if (userName == "user4" && string.IsNullOrEmpty(bo.Step4) && !string.IsNullOrEmpty(bo.Step3))
                flag = true;
            else if (userName == "user5" && string.IsNullOrEmpty(bo.Step5) && !string.IsNullOrEmpty(bo.Step4))
                flag = true;                

            return flag;
        }

        public static bool IsCanEditOrSubmit(string userName, BankBill bo)
        {
            bool flag = false;
            if (userName == "user1" && string.IsNullOrEmpty(bo.Step1))
                flag = true;
            return flag;
        }

    }
}
